package design_pattern.factory.abstract_factory;

import design_pattern.factory.simple_factory.Red;
import design_pattern.factory.simple_factory.Yellow;

/**
 * 具体工厂类——用于生产具体商品
 *
 * @author 15594
 */
public class BookFactory extends AbstractFactory {


    @Override
    public Colour getColour(String colour) {
        return null;
    }

    @Override
    public Book getBook(String book) {
        switch (book){
            case "English":
                return new EnglishBook();
            case "Music":
                return new MusicBook();
            default:
                throw new RuntimeException("没有这本书");
        }
    }
}
